package cn.sdormitory.exam.entity;

import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateSerializer;
import lombok.Data;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import io.swagger.annotations.ApiModelProperty;

import java.time.LocalDate;
import java.time.LocalDateTime;


/**
 * @author yy
 */

@Data
@TableName(value ="exam")
public class Exam {

    @TableId(value="id")
    @ApiModelProperty(value="主键")
    private Integer id;

    @TableField(value="name")
    @ApiModelProperty(value="考试名称")
    private String name;

    @TableField(value="exam_date")
    @ApiModelProperty(value="考试日期")
    @JsonSerialize(using = LocalDateSerializer.class)
    @JsonFormat(shape=JsonFormat.Shape.STRING, pattern="yyyy-MM-dd")
    private LocalDate examDate;

    @TableField(value="remark")
    @ApiModelProperty(value="备注")
    private String remark;

    @TableField(value="is_release")
    @ApiModelProperty(value="是否发布")
    private Boolean isRelease;

    @TableField(value="create_time")
    @ApiModelProperty(value="创建时间")
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonFormat(shape=JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;

    @TableField(value="create_by")
    @ApiModelProperty(value="创建人")
    private String createBy;

    @TableField(value="modify_time")
    @ApiModelProperty(value="修改时间")
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonFormat(shape=JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss")
    private LocalDateTime modifyTime;

    @TableField(value="modify_by")
    @ApiModelProperty(value="修改人")
    private String modifyBy;

}
